<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="ClientBranch.aspx.vb" Inherits="GTSWeb_ClientBranch" title="GTS Frieght Management System"  MaintainScrollPositionOnPostback="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
   <h3>Client Branch</h3>
       <table width="60%">
        <tr>
            <td style="width: 62px; height: 22px; text-align: right;">
                &nbsp;<strong>Branch</strong></td>
            <td style="width: 140px; height: 22px">
                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource1"
                    DataTextField="BranchName" DataValueField="ClientBranchID" Width="299px">
                </asp:DropDownList>&nbsp;
            </td>
        </tr>
    </table>
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
        CellPadding="4" DataKeyNames="ClientBranchID,ClientId,ContactInfoId,LocationId" DataSourceID="ObjectDataSource2"
        ForeColor="#333333" GridLines="None" Height="55px" Width="60%" EmptyDataText="No Branches Found!">
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
        <EditRowStyle BackColor="#999999" Width="50px" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <Fields>
            <asp:BoundField DataField="BranchName" HeaderText="Branch Name" SortExpression="BranchName" />
            <asp:TemplateField HeaderText="Status ID" SortExpression="StatusID">
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="StatusSource" DataTextField="StatusName"
                        DataValueField="StatusID" SelectedValue='<%# Bind("StatusID") %>'>
                    </asp:DropDownList><asp:ObjectDataSource ID="StatusSource" runat="server" OldValuesParameterFormatString="original_{0}"
                        SelectMethod="getStatus" TypeName="GTSSystem.BLL.Status"></asp:ObjectDataSource>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="StatusSource" DataTextField="StatusName"
                        DataValueField="StatusID" SelectedValue='<%# Bind("StatusID") %>'>
                    </asp:DropDownList><asp:ObjectDataSource ID="StatusSource" runat="server" OldValuesParameterFormatString="original_{0}"
                        SelectMethod="getStatus" TypeName="GTSSystem.BLL.Status"></asp:ObjectDataSource>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="StatusSource" DataTextField="StatusName"
                        DataValueField="StatusID" Enabled="False" SelectedValue='<%# Bind("StatusID") %>'>
                    </asp:DropDownList><asp:ObjectDataSource ID="StatusSource" runat="server" OldValuesParameterFormatString="original_{0}"
                        SelectMethod="getStatus" TypeName="GTSSystem.BLL.Status"></asp:ObjectDataSource>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="LocationID" HeaderText="Location ID" SortExpression="LocationID" InsertVisible="False" Visible="False" />
            <asp:BoundField DataField="ContactName" HeaderText="Contact Name" SortExpression="ContactName" />
            <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
            <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="StreetAddress" HeaderText="Street Address" SortExpression="StreetAddress" />
            <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
            <asp:BoundField DataField="ProvinceState" HeaderText="Province" SortExpression="ProvinceState" />
            <asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" />
            <asp:BoundField DataField="PostalCode" HeaderText="Postal Code" SortExpression="PostalCode" />
            <asp:BoundField DataField="ContactInfoID" HeaderText="Contact Info ID" SortExpression="ContactInfoID" InsertVisible="False" Visible="False" />
            <asp:BoundField DataField="ClientID" HeaderText="Client ID" SortExpression="ClientID" InsertVisible="False" Visible="False" />
            <asp:BoundField DataField="ClientBranchID" HeaderText="Client Branch ID" ReadOnly="True"
                SortExpression="ClientBranchID" InsertVisible="False" Visible="False" />
            <asp:CommandField ShowEditButton="True" ShowInsertButton="True" />
        </Fields>
        <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" VerticalAlign="Top" Width="120px" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <InsertRowStyle Width="50px" />
        <HeaderTemplate>
            Branch Information
        </HeaderTemplate>
    </asp:DetailsView>
    &nbsp;<br />
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" InsertMethod="CreateClientBranch"
        OldValuesParameterFormatString="{0}" SelectMethod="getClientBranchInfo"
        TypeName="GTSSystem.BLL.ClientBranch" UpdateMethod="UpdateClientBranch">
        <UpdateParameters>
            <asp:Parameter Name="ClientBranchId" Type="Int32" />
            <asp:Parameter Name="ClientId" Type="Int32" />
            <asp:Parameter Name="StatusId" Type="Int32" />
            <asp:Parameter Name="ContactInfoId" Type="Int32" />
            <asp:Parameter Name="locationId" Type="Int32" />
            <asp:Parameter Name="BranchName" Type="String" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="ProvinceState" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter Name="PostalCode" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="ClientBranchID" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:ProfileParameter Name="ClientId" PropertyName="ClientId" Type="Int32" />
            <asp:Parameter Name="StatusId" Type="Int32" />
            <asp:Parameter Name="BranchName" Type="String" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="ProvinceState" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter Name="PostalCode" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" InsertMethod="CreateClientBranch"
        OldValuesParameterFormatString="{0}" SelectMethod="getClientBranch"
        TypeName="GTSSystem.BLL.ClientBranch" UpdateMethod="UpdateClientBranch">
        <UpdateParameters>
            <asp:Parameter Name="ClientBranchId" Type="Int32" />
            <asp:Parameter Name="ClientId" Type="Int32" />
            <asp:Parameter Name="StatusId" Type="Int32" />
            <asp:Parameter Name="ContactInfoId" Type="Int32" />
            <asp:Parameter Name="locationId" Type="Int32" />
            <asp:Parameter Name="BranchName" Type="String" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="ProvinceState" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter Name="PostalCode" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ProfileParameter Name="ClientiD" PropertyName="ClientId" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="ClientId" Type="Int32" />
            <asp:Parameter Name="StatusId" Type="Int32" />
            <asp:Parameter Name="BranchName" Type="String" />
            <asp:Parameter Name="ContactName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="StreetAddress" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="ProvinceState" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter Name="PostalCode" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>

